import DS from 'ember-data';
import BaseModel from './base-model';

export default BaseModel.extend({
  dateService: Ember.inject.service("date-service"),
  typeName:DS.attr('string'),//规定项目
  typeItemName:DS.attr('string'),//规定细则
  // achievementsTypeItem:DS.belongsTo('employeeachievementstypeitem'),//绩效细则
  // achievementsType:DS.belongsTo('employeeachievementstype'),//规定项目
  type:DS.belongsTo('dicttype'),//奖罚类型 奖励/罚款
  employee:DS.belongsTo('employee'),//奖罚员工
  salaryPosition:DS.belongsTo('salaryposition'),//职位
  amount:DS.attr('number'),//奖罚金额（暂时不用）
  createTime:DS.attr('number'),//创建时间
  remark:DS.attr('string'),//备注
  lastUpdateUser: DS.belongsTo('user'), //更新操作者userid
  createDateTime: DS.attr('number'), //创建时间
  createUser: DS.belongsTo('user'), //创建人(操作人)
  lastUpdateDateTime: DS.attr('number'), //更新时间

  createTimeStr:Ember.computed("createTime",function(){
    var createTime = this.get("createTime");
    return this.get("dateService").formatDate(createTime,"yyyy-MM-dd hh:mm");
  }),

  createTimeDate:Ember.computed('createTime',function(){
    var createTimeDate = this.get("createTime");
    return this.get("dateService").timestampToTime(createTimeDate);
  }),

});
